package builder.actors;

import builder.roles.Director;

public class DocumentDirector implements Director {
    /**
     * @author chj
     * 属性含义：文档建造者接口对象
     */
    private DocumentBuilder documentBuilder;

    public DocumentDirector(DocumentBuilder documentBuilder) {
        this.documentBuilder = documentBuilder;
    }

    /**
     * @author chj
     * 方法含义：建造文档
     * @param title 文档的标题
     * @param string 文档的字符串
     * @param items 文档的条目
     */
    public void constructDocument(String title,String string,String[] items){
        documentBuilder.makeTitle(title);
        documentBuilder.makeString(string);
        documentBuilder.makeItems(items);
        documentBuilder.close();
    }
}
